import java.util.Scanner;

/**
 * Created by JiaJia on 2019/3/30 0030.
 */
public class PrimeFactors {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        while(sc.hasNext()){
            int input=sc.nextInt();
            System.out.println(primeFactors(input));

        }
    }

    private static String primeFactors(int input){
        StringBuilder sb = new StringBuilder();
        int i=2;
        while(input>=i) {
            while (input % i == 0) {
                sb.append(i).append(" ");
                input = input / i;
            }
            i++;
        }
        return sb.toString();

    }


}